package com.zwan.oam_rtc.bean.appdemoentity;


/**
 * @Author Kent Jiang
 * @Date 2020/8/24 15:47
 * @Version 1.0
 */
public class TvResponse {

    private int code;
    private String msg;
    private Object data;
    private static final String SUCCESS = "success";
    public static final int SUCCESS_CODE = 200;
    public static final int FAILED_CODE = 600;

    public TvResponse() {
    }


    public TvResponse(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public TvResponse(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public String getMsg() {
        return this.msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return this.data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public static TvResponse success(String msg, Object data) {
        return new TvResponse(200, msg, data);
    }

    public static TvResponse success(Object data) {
        return new TvResponse(SUCCESS_CODE, SUCCESS, data);
    }

    public static TvResponse success() {
        return new TvResponse(SUCCESS_CODE, SUCCESS);
    }

    public static TvResponse error(int code, String msg) {
        return new TvResponse(code, msg);
    }

    public static TvResponse error(String msg) {
        return new TvResponse(FAILED_CODE, msg);
    }
}
